#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
int main(int argc,const char*argv[])
{
    pid_t pid;
    if((pid = fork()<0))
    {
        perror("folk err");
        return -1;
    }
    else if(pid == 0)
    {
        printf("in child ");
        printf("pid:%d ppid:%d\n",getpid(),getppid());
    }
    else 
    {
        printf("in parent ");
        printf("pid:%d ppid:%d\n",pid,getpid());

    }
    return 0;
}